﻿@{
    ViewBag.Title = "My Projects";
}

<br />
<br />
<h3><i>My Projects Panel</i></h3>
<br /> <br />

@if(ViewBag.IsPI == true)
{
    <div>Projects I am a Primary Investigator for:</div>
    <br /><br />
    <table>
          <thead>
            
            <tr>
                <td>Project Name</td>
                <td>Primary Investigator</td>
                <td>Data Manager</td>
                <td>Size (GB)</td>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in ViewBag.PIList)
            {
                <tr>
                    <td><a href="/MyProjects/ProjectDetail?ID=@item.ProjectID&UID=@ViewBag.PIUserID">@item.strProjectName</a></td>
                    <td>@item.PI.strFirstName @item.PI.strLastName</td>
                    <td>@item.DM.strFirstName @item.DM.strLastName</td>
                    <td>@item.intStorageSize</td>            
                </tr>
            }
        
        </tbody>
    </table>   
    <br /><br/>
}

@if(ViewBag.IsDM == true)
{
    <div>Projects I am a Data Manager for:</div>
        <table>
            <thead>
            <tr>
                <td>Project Name</td>
                <td>Primary Investigator</td>
                <td>Data Manager</td>
                <td>Size (GB)</td>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in ViewBag.DMList)
            {
                <tr>
                    <td><a href="/MyProjects/ProjectDetail?ID=@item.ProjectID&UID=@ViewBag.DMUserID">@item.strProjectName</a></td>
                    <td>@item.PI.strFirstName @item.PI.strLastName</td>
                    <td>@item.DM.strFirstName @item.DM.strLastName</td> 
                    <td>@item.intStorageSize</td>           
                </tr>
            }
        
        </tbody>
    </table>
    <br /><br />
}

@if(ViewBag.ProjList != null)
{
    <div>Projects I am a Researcher for:</div>
    <br /><br />
        <table>
            <thead>
            <tr>
                <td>Project Name</td>
                <td>Primary Investigator</td>
                <td>Data Manager</td>
                <td>Size (GB)</td>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in ViewBag.ProjList)
            {
                <tr>
                    <td><a href="/MyProjects/ProjectDetail?ID=@item.ProjectID&UID=@ViewBag.UserID">@item.strProjectName</a></td>
                    <td>@item.PI.strFirstName @item.PI.strLastName</td>
                    <td>@item.DM.strFirstName @item.DM.strLastName</td>   
                    <td>@item.intStorageSize</td>         
                </tr>
            }
        
        </tbody>
    </table>
}
